local skynet     = require "skynet"
local bewater    = require "bw.bewater"
local http_agent = require "bw.server.http_agent"
local log        = require "bw.log"
local sname      = require "sname"
local Rank       = bewater.proxy(sname.RANK)

local M = {
    url = "/center/rank/submit",
    auth = true,
    data = {
        appname = "string",
        rankname = "string",
        item = "table",
    },
}

function M.handler(_, req, acc)
    local name = req.appname .. "_" .. req.rankname
    Rank.update(name, acc, req.item)
    return 0
end

http_agent.reg(M)
